﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="wfCompras.WebForm2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %> 
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .modalBackground {
            background-color:#333333;
            filter:alpha(opacity=70);
            opacity:0.7;
        }
        .modalPopup {
            background-color:#FFFFFF;
            border-width:1px;
            border-style:solid;
            border-color:#CCCCCC;
            padding:1px;
            width:300px;
            Height:200px;
        }   
    </style> 
</head>
<body>
    <form id="form1" runat="server">
  <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div>
        <asp:UpdatePanel ID="udpOutterUpdatePanel" runat="server">
             <ContentTemplate>


                <div id="divControlContainer" runat="server"></div>
                <input id="dummy" type="button" style="display: none" runat="server" />


                <ajaxToolkit:ModalPopupExtender runat="server"
                        ID="mpeThePopup"
                        TargetControlID="dummy"
                        PopupControlID="pnlModalPopUpPanel"
                        BackgroundCssClass="modalBackground"                       
                        DropShadow="true"/>



                 <asp:Panel ID="pnlModalPopUpPanel" runat="server" CssClass="modalPopup">


                    <asp:UpdatePanel ID="udpInnerUpdatePanel" runat="Server" UpdateMode="Conditional">
                        <ContentTemplate>
                            <p>
                                <asp:DropDownList ID="ddlProducts" runat="server"></asp:DropDownList>                               
                                &nbsp;
                                <asp:Button ID="btnChooseProduct" runat="server" Text="Choose" onclick="btnChooseProduct_Click"/>
                                &nbsp;
                                <asp:Button ID="btnCancelModalPopup" runat="server" Text="Cancel" 
                                    onclick="btnCancelModalPopup_Click" />
                            </P>
                            <p>
                                <asp:Label ID="lblText" runat="server"></asp:Label><br />
                            </p>
                            <p>
                                &nbsp;</p>
                            <p>
                                &nbsp;</p>
                        </ContentTemplate>      


                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="btnChooseProduct" EventName="Click" />
                            <asp:AsyncPostBackTrigger ControlID="btnChooseProduct" EventName="Click" />
                        </Triggers>


                    </asp:UpdatePanel>
                 </asp:Panel>


            </ContentTemplate>
        </asp:UpdatePanel>
    </div> 


<asp:GridView ID="mlbGridView" runat="server" AllowPaging="True" AutoGenerateColumns="False" DataKeyNames="ID" DataSourceID="mlbDataSource" ShowFooter="True"  OnRowCommand="mlbGridView_RowCommand">
           
              
        <Columns>
                  <asp:TemplateField>
        

<FooterTemplate>
    <asp:Button ID="btnInsert" runat="server" UseSubmitBehavior="true"
                Text="Insert" CommandName="Add" />
    </FooterTemplate>
</asp:TemplateField>
                
                 <asp:TemplateField HeaderText="Description"
                       SortExpression="Description">
    <ItemTemplate>
    <asp:Label ID="lblDescription" runat="server"
               Text='<%#CType(Container.DataItem, System.Data.DataRowView).Item("Description")%>'>
    </asp:Label>
    </ItemTemplate>
    <EditItemTemplate>
    <asp:TextBox ID="txtDescription" runat="server"
                 Text='<%#Bind("Description") %>'>
    </asp:TextBox>
    </EditItemTemplate>
   

<FooterTemplate>
    <asp:TextBox TextMode="MultiLine" Columns="50" Rows="10" Wrap="true" ID="txtDescription2" runat="server">
    </asp:TextBox>
    </FooterTemplate>
    </asp:TemplateField>
         
            </columns>
       
    </asp:GridView>    